/**
 * KopsoxFramework
 * Copyright (C) 2010 Free Software Foundation, Inc. <http://fsf.org/>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.

 */
package org.kopsox.general.priority;

import org.kopsox.general.priority.impl.LoggingPriorityImpl;

/**
 * @author Konrad Renner
 *
 */
public enum LoggingPriorityEnum {

	ALL(new LoggingPriorityImpl(1)),
	TRACE(new LoggingPriorityImpl(2)),
	DEBUG(new LoggingPriorityImpl(3)),
	INFO(new LoggingPriorityImpl(4)),
	WARNING(new LoggingPriorityImpl(5)),
	ERROR(new LoggingPriorityImpl(6)),
	FATAL(new LoggingPriorityImpl(7)),
	OFF(new LoggingPriorityImpl(8));
	
	private final LoggingPriority value;
	
	private LoggingPriorityEnum(LoggingPriority value){
		this.value = value;
	}
	
	public LoggingPriority getPriority(){
		return value;
	}
	
	public static String getPriorityValueAsString(LoggingPriority priority) {
		if(ALL.getPriority().equals(priority)) {
			return ALL.toString();
		}else if(TRACE.getPriority().equals(priority)) {
			return TRACE.toString();
		}else if(DEBUG.getPriority().equals(priority)) {
			return DEBUG.toString();
		}else if(INFO.getPriority().equals(priority)) {
			return INFO.toString();
		}else if(WARNING.getPriority().equals(priority)) {
			return WARNING.toString();
		}else if(ERROR.getPriority().equals(priority)) {
			return ERROR.toString();
		}else if(FATAL.getPriority().equals(priority)) {
			return FATAL.toString();
		}else {
			return OFF.toString();
		}
	}
}
